<script setup>
import { get } from '@/util/axios'
import { ElMessage } from 'element-plus';
import router from '@/router';
import { useStore } from '@/stores';

const store = useStore()

const logout = () => {
  get('/api/auth/logout', (message) => {
    ElMessage.success(message)
    store.auth.user = null
    router.push('/')
  })
}
</script>

<template>
  <div>
    欢迎 {{ store.auth.username }} 用户进入系统
  </div>

  <div>
    <el-button type="" @click="logout">退出登录</el-button>
  </div>
</template>

<style>

</style>